package cn.qh.com.service.imp;

import cn.qh.com.mapper.Mapper;
import cn.qh.com.model.Person;
import cn.qh.com.service.ServiceInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @project: crud
 * @description:
 * @author:
 * @date: 2021-08-17-11:29
 * @version: 1.0
 * @website:
 */
@Service
public  class ServiceImp implements ServiceInterface {

    @Autowired(required = false)
    private Mapper mapper;

    @Override
    public Person queryById(int id) {

        return mapper.queryById(id);
    }

    @Override
    public List<Person> queryAll() {
        return mapper.queryAll();
    }

    @Override
    public void insert(Person person) {
        mapper.insert(person);
    }

    @Override
    public int delete(int id) {
        return mapper.delete(id);
    }

    @Override
    public void update(Person person) {
        mapper.update(person);
    }
}
